#if !defined(AFX_TIME_H__4D84F5B7_572F_11D1_93C2_006097737B41__INCLUDED_)
#define AFX_TIME_H__4D84F5B7_572F_11D1_93C2_006097737B41__INCLUDED_


#include <ctime>
#include <iostream>
using namespace std;
// to find out how long different operations takes

class Time {
public:
	Time() { now = time(NULL);}

	friend ostream& operator << (ostream &os, Time &tm)
	{
		tm.old = tm.now;
		tm.now = time(NULL);
		int total = int(tm.now-tm.old); // output in seconds
		int min = total/60;  // to get minutes
		int sec = total - min*60;
		if (min > 0) cout << " " << min << " min ";
		os << sec << " sec\n";
		return os;
	}
private:
	time_t now;
	time_t old;
};

#endif // !defined(AFX_ZFUNCTION_H__4D84F5B7_572F_11D1_93C2_006097737B41__INCLUDED_)
